#include <GameEngine/Graphics/Scene/scene_element.h>


#ifdef GAMEENGINE_NAMESPACES
namespace GameEngine {
#endif


//! Default constructor
/*!
 @param type The type of the element
 */
SceneElement::SceneElement(ElementType type) : type_(type) {}

//! Copy constructor
/*!
 @param rhs The scene element to copy
 */
SceneElement::SceneElement(const SceneElement& rhs) : type_(rhs.type_) {}

//! Destructor
SceneElement::~SceneElement() {}

//! Assignment operator
/*!
 @param rhs The scene element to copy
 */
SceneElement& SceneElement::operator=(const SceneElement& rhs) {
	if ( &rhs != this ) {
		type_ = rhs.type_;
	}
	return *this;
}

//! Prepares the scene element to be drawn
/*!
 *  This function is called by the scene prior to the draw() function
 *  in order to allow the scene element to be prepared.
 *
 @return True if the scene element was correctly prepared, false otherwise
 @note Default implementation does nothing and always returns true
 */
bool SceneElement::prepare_draw() {
	return true;
}

//! Cleanup the scene element after it has been drawn
/*!
 *  This function is called by the scene after to the draw() function
 *  in order to allow the scene element to be cleaned up.
 *
 @return True if the scene element was correctly cleaned, false otherwise
 @note Default implementation does nothing and always returns true
 */
bool SceneElement::finish_draw() {
	return true;
}

//! Accessor to the type of the scene element (read only)
/*!
 @return The type of the scene element
 */
SceneElement::ElementType SceneElement::type() const {
	return type_;
}

//! Accessor to the type of the scene element (read-write)
/*!
 @return A reference to the type of the scene element
 */
SceneElement::ElementType& SceneElement::type() {
	return type_;
}


#ifdef GAMEENGINE_NAMESPACES
} // namespace GameEngine
#endif
